package Casino;

/***************************
Nathan Mulder
Troy Reed
Group Project
Casino
**************************/


import Casino.Donate;
import java.util.Scanner;

public class MainProgram
{
   public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		Wallet wallet = new Wallet();
		CasinoGames cgames = new CasinoGames();
		Donate donate = new Donate();
		
		System.out.println("Welcome to the Casino!");
		gameInstructions();
		displayMenu();
		wallet.setMoney(200);
		
		int menuChoice = input.nextInt();
		if (wallet.getMoney() < 2000)
		{
			while (menuChoice != 7)
			{
				switch (menuChoice)
				{
					case 1:
						System.out.printf("You currently have $%.2f in your wallet.\nYou currently owe $%.2f to the Loan Shark.", wallet.getMoney(), wallet.getLoanAmount());
						break;
					case 2:
						cgames.gameList();
						break;
					case 3:
						donate.donateMoney();
						break;
					case 4:
						wallet.makeLoan();
						break;
					case 5:
						wallet.repayLoanAmount();
						break;
					case 6:
						gameInstructions();
						break;
					default:
						System.out.print("You have entered an invalid option. Please enter a menu option 1-6.");
						break;
				}
				displayMenu();
				menuChoice = input.nextInt();
			}
		}
		
		else
		{
			if (wallet.getLoanAmount() == 0)
				System.out.println("You Win!");
			else
			{
				displayMenu();
				menuChoice = input.nextInt();
			}

		}
	}
	
   private static void displayMenu()
	{
		System.out.println("\n\nPlease choose one of the following menu options:");
		System.out.print("1...Check my wallet.\n2...Choose from the list of available games!\n3...Make a charitable donation.\n4...Take out a loan with a loan shark.\n5...Repay the Loan Shark\n6...Read Instructions.\n7...Exit the Casino\nChoice:");
		
	}
	
	private static void gameInstructions()
	{
		System.out.print("Instructions:\nHave $2000 in your wallet with no outstanding loans with the Loan Shark.\nPlay games to earn (or loose) money.\nDonate to Charity to increase the luck of your earnings.\nGood Luck!");
	}

}